﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Editor Editor { set; get; }
        public Doc Doc { set; get; }
        public Form1()
        {
            InitializeComponent();
            this.Doc = new Doc("笔记");
            this.Editor = new Editor(this.Doc);
        }

 


        private void button1_Click(object sender, EventArgs e)
        {
            this.Editor.Undo();
            this.textBox1.Text=this.Editor.Doc.Body;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Doc.Body = textBox1.Text;
            this.Editor.BackUp();
        }
    }
}
